\rcube_text2html

Converts plain text to HTML

Summary

Methods
Properties
Constants
__construct()
set_text()
get_html()
print_html()
No public properties found
No constants found
_convert()
_converter()
_convert_line()
$html
$text
$config
$_converted
N/A
No private methods found
No private properties found
N/A

Properties

$html

$html : string

Type

string — Contains the HTML content after conversion

$text

$text : string

Type

string — Contains the plain text

$config

$config : array

Type

array — Configuration

$_converted

$_converted : bool

Type

bool — Internal state

Methods

__construct()

__construct(string  $source = '', bool  $from_file = false, array  $config = []) : mixed

Constructor.

If the plain text source string (or file) is supplied, the class will instantiate with that source propagated, all that has to be done it to call get_html().

Parameters

string $source

Plain text

bool $from_file

Indicates $source is a file to pull content from

array $config

Class configuration

Returns

mixed —

set_text()

set_text(string  $source, bool  $from_file = false) : mixed

Loads source text into memory, either from $source string or a file.

Parameters

string $source

Plain text

bool $from_file

Indicates $source is a file to pull content from

Returns

mixed —

get_html()

get_html() : string

Returns the HTML content.

Returns

string —

HTML content

print_html()

print_html() : mixed

Prints the HTML.

Returns

mixed —

_convert()

_convert() : mixed

Workhorse function that does actual conversion (calls _converter() method).

Returns

mixed —

_converter()

_converter(string  $text) : string

Workhorse function that does actual conversion.

Parameters

string $text

Plain text

Returns

string —

HTML content

_convert_line()

_convert_line(string  $text, bool  $is_flowed) : string

Converts spaces in line of text

Parameters

string $text

Plain text

bool $is_flowed

Is the $text format=flowed?

Returns

string —

Converted text